package com.shixun.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.shixun.dto.JsonDto;
import com.shixun.service.StatesAndCityService;
@RestController
@RequestMapping("/api/StatesAndCity")
public class StatesAndCityController {//省市管理
    @Autowired
    StatesAndCityService statesAndCityService;
    @GetMapping("/listStatesAndCity")
    public JsonDto listStatesAndCity(){//获取所有省市信息
        JsonDto jsonDto=new JsonDto();
        jsonDto.setId(1);
        jsonDto.getDatas().put("statesList",statesAndCityService.listStates());
        jsonDto.getDatas().put("cityList",statesAndCityService.listCity());
        return jsonDto;
    }
}
